#ifndef SCRIPTGENERATORWIZARD_H
#define SCRIPTGENERATORWIZARD_H

#include<QCheckBox>
#include<QComboBox>
#include<QDoubleValidator>
#include<QGridLayout>
#include<QHBoxLayout>
#include<QIntValidator>
#include<QLabel>
#include<QLineEdit>
#include<QMessageBox>
#include<QVBoxLayout>
#include<QWidget>
#include<QWizard>
#include<QWizardPage>

#include"ActionType.h"
#include"EventType.h"
#include"ScriptEntryRaw.h"
#include"SourceType.h"
#include"TargetType.h"

enum Pages{
	PAGE_LINK,
	PAGE_PHASEMASK,
	PAGE_CHANCE,
	PAGE_EVENTFLAGS,
	PAGE_EVENTTYPE,
	PAGE_EVENTPARAMS,
	PAGE_ACTION,
	PAGE_ACTIONPARAMS,
	PAGE_TARGET,
	PAGE_TARGETPARAMS,
	PAGE_COMMENTS,
};

class ScriptGeneratorWizard: public QWizard
{
public:
	ScriptGeneratorWizard(bool advanced, QWidget *parent);
    ~ScriptGeneratorWizard();
	bool validateCurrentPage();
	ScriptEntryRaw *getSQL(QString &sql, QString &comment);
private:
	QWizardPage *linkPage();
	QWizardPage *phaseMaskPage();
	QWizardPage *chancePage();
	QWizardPage *eventFlagsPage();
	QWizardPage *eventTypePage();
	QWizardPage *eventParametersPage();
	QWizardPage *actionPage();
	QWizardPage *actionParametersPage();
	QWizardPage *targetTypePage();
	QWizardPage *targetParametersPage();
	QWizardPage *commentsPage();

	void setEventTypeParameters(int current);
	void setActionTypeParameters(int current);
	void setTargetTypeParameters(int current);

	ScriptEntryRaw *m_script;
	bool m_usedScript;

	QLineEdit *m_editLink;
	QLineEdit *m_editPhaseMask;
	QLineEdit *m_editChance;

	QCheckBox *m_checkRepeat, *m_check0, *m_check1, *m_check2, *m_check3, *m_checkDebug;

	QComboBox *m_comboEventType;

	QLineEdit *m_editEventParam1, *m_editEventParam2, *m_editEventParam3, *m_editEventParam4;
	QLabel *m_eventParam1Description, *m_eventParam2Description, *m_eventParam3Description, *m_eventParam4Description;

	QComboBox *m_comboActionType;
	
	QLineEdit *m_actionParam1, *m_actionParam2, *m_actionParam3, *m_actionParam4, *m_actionParam5, *m_actionParam6;
	
	QWidget *m_actionParamWidget1, *m_actionParamWidget2, *m_actionParamWidget3, *m_actionParamWidget4, *m_actionParamWidget5, *m_actionParamWidget6;
	QVBoxLayout *m_actionParamLayout1, *m_actionParamLayout2, *m_actionParamLayout3, *m_actionParamLayout4, *m_actionParamLayout5, *m_actionParamLayout6;
	QLabel *m_actionParam1Description;
	QLabel *m_actionParam2Description;
	QLabel *m_actionParam3Description;
	QLabel *m_actionParam4Description;
	QLabel *m_actionParam5Description;
	QLabel *m_actionParam6Description;
	
	QComboBox *m_comboTarget;
	
	QLineEdit *m_editTarget1;
	QLineEdit *m_editTarget2;
	QLineEdit *m_editTarget3;
	QLabel *m_targetDescription1, *m_targetDescription2, *m_targetDescription3;
	QLineEdit *m_editTargetX, *m_editTargetY, *m_editTargetZ, *m_editTargetO;
	QLabel *m_labelX, *m_labelY, *m_labelZ, *m_labelO;
	
	QLineEdit *m_comments;
};

#endif // SCRIPTGENERATORWIZARD_H
